home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-02-12 | 3.1 KB | 93 lines | [TEXT/MSWD] |
- !
- ! Liaison 3.0.2 script for the Apple PowerBook Internal modem.
- !
- ! Copyright © 1992, Farallon Computing, Inc. All rights reserved.
- ! revision 1.0 3/13/92 FK
- !
- !
- Name "PowerBook Internal" ! what the user sees
- !
- !
- ! Common entry point - dispatch on the current and future state. Cases are:
- !
- ! 1) Off-hook, ending a connection and releasing the modem
- ! 2) On-hook, preparing to answer (i.e. awaiting a call)
- ! 3) Off-Hook, ending a connection and resuming answer wait
- ! 4) On-hook, initiating a call
- !
- 10 IfVar 1 1 20 ! if off-hook, signal modem
- IfnVar 1 3 30 ! otherwise, skip around
- !
- ! We're off-hook, so try to hang up the modem by dropping DTR momentarily.
- ! (This will work if the modem remembers its &D2 setting)
- !
- 20 DtrOff ! drop DTR to hang up
- Wait 2 ! wait up to 2 sec for response
- DtrOn ! restore DTR
- !
- ! If the modem did not respond, use the dumb attention sequence.
- !
- IfVar 0 15 30 ! branch if modem responded
- Pause 66 ! quiet for 1.1 sec
- Xmit "+++" ! send the attention command
- Wait 2 ! wait up to 2 sec for response
- !
- ! Configure the generic Hayes 2400 modem options, including DTR control.
- !
- 30 SerReset 0 ! restore user-defined speed
- Xmit "AT &F\13" ! generic modem setup
- Wait 5 ! wait for the response
- Xmit "AT E0 Q0 S0=0 V1 X4 H\13" ! generic modem setup
- Wait 2 ! wait for the response
- !
- ! Lastly, configure the Intenal modem features and modem responses.
- !
- Xmit "AT N1 W2 &K4 &Q5 S36=7 S37=6 S11=50\13" ! anySpeed noProgr Xon/OFF ErrorCtl
- Wait 2 ! wait for the response
- !
- ! If not just hanging up, define the responses we'll accept.
- !
- IfVar 1 1 50 ! if we're just hanging up
- Match 1 90 "NO CARR" ! redefine termination event
- Match 2 80 "CONNECT\13" ! define activation events
- Match 3 80 "T 12" ! "CONNECT 1200"
- Match 4 80 "T 24" ! "CONNECT 2400"
- Match 5 80 "T 48" ! "CONNECT 4800"
- Match 6 80 "T 96" ! "CONNECT 9600"
- Match 7 80 "T 19" ! "CONNECT 19.2"
- Match 8 80 "T 38" ! "CONNECT 38.4"
- !
- ! To allow Answering, let the modem go off-hook on the 1st ring.
- !
- IfVar 1 4 60 ! if we're initiating a call
- 40 Xmit "AT S0=1\13" ! go off-hook on 1st ring
- 50 Exit ! then wait for a response
- !
- ! To place a call, issue the phone number and wait for a response.
- !
- 60 Match 10 70 "NO DIAL" ! define modem abort events
- Match 11 70 "BUSY" !
- Match 12 70 "NO AN" ! "NO ANSWER"
- Xmit "AT DT " ! touch-tone dial
- Dial ! the user phone number
- Xmit "\13" ! with a terminating EOL
- Exit ! then wait for a response
- !
- ! On receipt of a dialing abort message, begin a teardown.
- !
- 70 Hangup 0 ! result is message value
- !
- ! On receipt of "Connect", begin arbitration.
- !
- 80 Match 1 90 "NO CARR" ! drop all the other strings
- Pause 6 ! let the line settle down
- Carrier 0 ! we have carrier per msg
- Connect ! result is "Connected at xxxx"
- !
- ! On receipt of "No Carrier", begin a teardown.
- !
- 90 Hangup 1 ! result is "failed to connect"
- !
- ! SCRIPT END
- !
-